[FIX] Outlier detection: keep instance ids, make thread safe#5427
Merged
markotoplak merged 1 commit intobiolab:masterfrom May 12, 2021
Merged
[FIX] Outlier detection: keep instance ids, make thread safe#5427markotoplak merged 1 commit intobiolab:masterfrom
markotoplak merged 1 commit intobiolab:masterfrom
Conversation
6c50278 to
462dbe1
Compare
Codecov Report
@@ Coverage Diff @@
## master #5427 +/- ##
==========================================
- Coverage 86.37% 86.15% -0.22%
==========================================
Files 303 303
Lines 62157 61606 -551
==========================================
- Hits 53685 53077 -608
- Misses 8472 8529 +57 |
VesnaT
approved these changes
May 11, 2021
Contributor
VesnaT
left a comment
There was a problem hiding this comment.
A minor comment. Other than that, I'm happy to merge.
| class _OutlierModel(SklModel): | ||
| def __init__(self, skl_model): | ||
| super().__init__(skl_model) | ||
| self._cached_data = None |
Contributor
There was a problem hiding this comment.
This variable is no longer needed.
Outlier detection did not keep instance ids, so subsets did not work. Also, it was not thread safe: multiple calls to _OutlierModel.__call__ could result in undefined behaviour, because some caching was done at the object level.
462dbe1 to
587bf9d
Compare
Member
Author
|
@VesnaT, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Dataoutput of OWOutliers._OutlierModel.__call__could result in undefined behavior, because some caching was done at the object level.Description of changes
To fix (1), I just used domain transformations instead of copying. To fix (2), I replaced object-level caching with
SharedComputeValue.Includes